<?php

?>
<script type="text/javascript" xmlns="http://www.w3.org/1999/html">

    var account_status = [
        {id:'y',name:'Enabled'},
        {id:'n',name:'Disabled'}
    ];
    var gender = [
        {id:'M',name:'M'},
        {id:'F',name:'F'}
    ];

    var complete = [
        {id:'0',name:'No'},
        {id:'1',name:'Yes'}
    ];
    var graduate = [
        {id:'0',name:'No'},
        {id:'1',name:'Yes'}
    ];
    var classifications = <?php echo json_encode($classify); ?>;
    var programs = <?php echo json_encode($programs); ?>;
    var level =  <?php echo json_encode($levels); ?>;
    var countries = <?php echo json_encode($countries); ?>;

</script>
<style>
    .update_link {
        font-size: 11px; margin-left: 15px;
    }

    #trans_reversal_modal .info {
        text-transform: uppercase;
        font-weight: bold;
    }

    .updatable {
        padding: 3px 5px;
        width: 200px;
        display: inline-block;
        margin-right: 15px;
    }

    .updatable.editing {
        border: solid #ddd 1px;
        background-color: #fff;
        border-radius: 3px;
    }
</style>

<div>
    <h4 style="margin-bottom: 20px;">Manage Student Accounts</h4>

    <table id="flex" style="display:none;"></table>

    <fieldset  style="margin-top: 40px;">
        <legend>Students Profile Settings</legend>
    </fieldset>

    <div class="row-fluid">
        <div class="span6">
            <form class="students-config-form- form-horizontal" id="students-config-form" method="post" action="" enctype="" style="margin: 0px;">
                <fieldset
                <div class="control-group">
                    <label class="control-label" for="password">Allow students to edit other part of their profile:</label>
                    <div class="controls">
                        <select name="profile_config_opt"  id="profile_config_opt">
                            <option value="No" <?php echo $config['students_can_edit_other_profile']=='No'?'selected':'' ;?> >No</option>
                            <option value="Yes" <?php echo $config['students_can_edit_other_profile']=='Yes'?'selected':'' ;?>>Yes</option>
                        </select>
                    </div>
                </div>
                <div class="control-group">
                    <div class="controls">
                        <button type="button" href="<?php echo $this->Html->url(array('action' => 'student_users/profile_config')); ?>" id="profile_config_btn" class="btn btn-primary">Save</button>
                    </div>
                </div>
            </form>
        </div>
    </div>

    <div id="reset_modal" class="modal hide fade">
        <form class="form form-horizontal" method="post" action="" enctype="" style="margin: 0px;">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4>Reset User Password</h4>
            </div>
            <div class="modal-body">

                <div class="control-group">
                    <label class="control-label" for="password">* New Password:</label>
                    <div class="controls">
                        <input id="password" name="password" type="text" value="" required="" class="input input-large" />
                    </div>
                </div>
                <input type="hidden" id="id" name="id" value="" />

            </div>
            <div class="modal-footer">
                <button type="submit" href="<?php echo $this->Html->url(array('action' => 'student_users/reset_password')); ?>" id="reset_pass_btn" class="btn btn-primary">Reset Password</button>
                <a href="#reset_modal" class="btn" data-toggle="modal">Close</a>
            </div>
        </form>
    </div>

</div>


<input type="hidden" id="table-url" value="<?php echo $this->Html->url(array('controller' => 'Staff', 'action' => 'student_users/get')); ?>" />
<input type="hidden" id="table-editable-url" value="<?php echo $this->Html->url(array('controller' => 'Staff', 'action' => 'student_users/save')); ?>" />
<input type="hidden" id="load_url" value="<?php echo $this->Html->url(array('controller' => 'Staff', 'action' => 'student_users/load')); ?>" />
<input type="hidden" id="delete_url" value="<?php echo $this->Html->url(array('controller' => 'Staff', 'action' => 'student_users/delete')); ?>" />

<?php
    echo $this->Html->script('staff/student_users.js');
?>